// pages/is_hit/is_hit.js
Page({
  data: {
    data: '',
    index: ''
  },
  onShow() {
    wx.setNavigationBarTitle({
      title: '文与字'
    })
  },
  navto(e) {
    let idx = e.currentTarget.id;
    this.setData({
      index: idx
    })
    wx.navigateTo({
      url: '/pages/wz_details/wz_details?index='+this.data.index
    })
  },
  onLoad() {
    let that = this;
    wx.request({
      url: 'https://www.easy-mock.com/mock/5a9654e43d01940a2cdf9980/wechat/news',
      data: '',
      header: {},
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: function(res) {
        that.setData({
          data: res.data
        })
      }
    })
  }
})